package com.jml.account.test.controller;

import org.activiti.engine.ProcessEngine;
import org.activiti.engine.ProcessEngineConfiguration;

public class ActivitiTest01 {
    /**
     * 创建activiti的25张表
     */
    public  static void testCreateTable(){
        //流程配置引擎
        ProcessEngineConfiguration pec = ProcessEngineConfiguration.createStandaloneProcessEngineConfiguration();

        pec.setJdbcDriver("com.mysql.jdbc.Driver");
        pec.setJdbcUrl("jdbc:mysql://localhost:3306/jeesite");
        pec.setJdbcUsername("root");
        pec.setJdbcPassword("1234");
        //选择true   会自动创建表且当数据发生变化时会更新表中的数据
        pec.setDatabaseSchemaUpdate(ProcessEngineConfiguration.DB_SCHEMA_UPDATE_TRUE);
        //创建流程引擎
        ProcessEngine pe = pec.buildProcessEngine();

    }
    /**
     * xml创建activiti的25张表
     */
    public static void testCreateTableWithXml(){
        ProcessEngineConfiguration pec = ProcessEngineConfiguration.createProcessEngineConfigurationFromResource("activiti.cfg.xml");
        pec.buildProcessEngine();
    }

    public static void main(String[] args) {
        testCreateTable();
    }

}